﻿using Sunny.UI;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace App.Desk
{
    public partial class FHeaderAsideMainFooter : UIHeaderAsideMainFooterFrame
    {
        public FHeaderAsideMainFooter()
        {
            InitializeComponent();

            ////设置关联
            //Aside.TabControl = MainTabControl;

            //int pageIndex = 1000;
            //TreeNode parent = Aside.CreateNode("控件", 61451, 24, pageIndex);
            ////通过设置PageIndex关联，节点文字、图标由相应的Page的Text、Symbol提供
            //Aside.CreateChildNode(parent, AddPage(new Form1(), ++pageIndex));
            //Aside.CreateChildNode(parent, AddPage(new Form2(), ++pageIndex));
            //Aside.CreateChildNode(parent, AddPage(new Form1(), ++pageIndex));
            //Aside.CreateChildNode(parent, AddPage(new Form2(), ++pageIndex));

            //parent = Aside.CreateNode("控件2", 61451, 24, pageIndex);
            //Aside.CreateChildNode(parent, AddPage(new Form2(), ++pageIndex));

            ////显示默认界面
            //Aside.SelectPage(1002);
        }

        private void Aside_MenuItemClick(System.Windows.Forms.TreeNode node, NavMenuItem item, int pageIndex)
        {
            Footer.Text = "PageIndex: " + pageIndex;
        }

        private void Aside_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (!ExistPage(1002))
            {
                //AddPage(new Form1());
            }

            SelectPage(1002);
        }

        private void FHeaderAsideMainFooter_Load(object sender, System.EventArgs e)
        {

        }
    }
}
